<script>
window.onload = function() {
  var oFCKeditor = new FCKeditor('object_and_resource_class_description');
  oFCKeditor.BasePath = "/javascripts/fckeditor/";
  oFCKeditor.Config["CustomConfigurationsPath"] =
    '<%= javascript_path "railsfck.js" %>';
  oFCKeditor.ReplaceTextarea();
}
</script>

<%= error_messages_for :object_and_resource_class %>

<% remote_form_for(@object_and_resource_class) do |f| %>
  <p>
    <b>Название</b><br />
    <%= f.text_field :name, :size => 100 %>
  </p>

  <p>
    <b>Описание</b><br />
    <%= f.text_area :description, :rows => 5, :cols => 60 %>
  </p>
  
  <p>
    <b>Подклассы</b><br />
    <%= check_box_tag 'object_and_resource_class[sc][]', 0, @object_and_resource_class.sub_classes[0] === 49, { :id => 'subclass1', :onclick => 'subclass_select_blocker()' } %> Результат научно-технической деятельности<br />
    <%= check_box_tag 'object_and_resource_class[sc][]', 1, @object_and_resource_class.sub_classes[1] === 49, { :id => 'subclass2', :onclick => 'subclass_select_blocker()' } %> Результат комерциализации<br />
    <%= check_box_tag 'object_and_resource_class[sc][]', 2, @object_and_resource_class.sub_classes[2] === 49, { :id => 'subclass3', :onclick => 'subclass_select_blocker()' } %> Исходные ресурсы, которые могут быть использованы для коммерциализации<br />
    <%= check_box_tag 'object_and_resource_class[sc][]', 3, @object_and_resource_class.sub_classes[3] === 49, { :id => 'subclass4', :onclick => 'subclass_select_blocker()' } %> Нежелательные последствия<br />
  </p>
  
  <script language="javascript">
    subclass_select_blocker();
  </script>

  <p>
    <b>Распределение</b><br />
    <%= f.radio_button :distribution, 0 %> Копирование
    <%= f.radio_button :distribution, 1 %> Деление
  </p>

  <p>
    <%= f.submit form_submit %> <%= link_to 'Отмена', '#', { :onclick => "$('object_and_resource_class_#{@object_and_resource_class.id}').update('<!-- -->')" } %>
  </p>
<% end %>